# This scipt can change a block in a file.
import my_function as my
# block_head is a word without = and {
block_head = "base_modifier"
with open(r'ck3/game_path.txt', 'r', encoding='utf-8') as file:
    game_path = file.read()  # 读取全部内容到一个字符串

file_path = game_path + r"/game/common/modifiers/00_basic_modifiers.txt"
new_block_content = block_head + """ = {
    faith_conversion_piety_cost_mult = -10
	faith_creation_piety_cost_mult = -1
	#monthly_county_control_growth_add = 1
    men_at_arms_recruitment_cost = -10
    #men_at_arms_title_limit = 100
    #siege_phase_time = -0.6
    #domain_limit = -20
	#ai_honor = 100
    ai_greed = 1000
    ai_ennergy = 1000
    ai_vengefulness = 1000
    #ai_boldness = 1000
    ai_rationality = -1000
    ai_compassion = -1000
	ai_war_chance = 1000
    ai_war_cooldown = -100
	#men_at_arms_cap = 3
	#men_at_arms_limit = 100
}"""
my.replace_block(file_path, block_head, new_block_content)

# block_head = "count_modifier"
# new_block_content = block_head + """ = {
#     domain_limit = 22
# 	knight_limit = 1
# 	tax_slot_add = 1
# 	ai_war_chance = -0.9
# 	monthly_treasury_from_liege_mult = -0.4
# }"""
# my.replace_block(file_path, block_head, new_block_content)

# block_head = "hegemon_modifier"
# new_block_content = block_head + """ = {
#     domain_limit = 25
# 	knight_limit = 9
# 	vassal_limit = 80
# 	ai_amenity_target_baseline = 0.4
# 	active_accolades = 3
# 	tax_slot_add = 2
# 	mercenary_hire_cost_mult = 0.8
# 	enemy_scheme_secrecy_add = -40
# 	county_fertility_growth_mult = 0.65
# }"""
# my.replace_block(file_path, block_head, new_block_content)